package com.qf.aop;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.springframework.aop.MethodBeforeAdvice;

/*
 *@Description:
 *@author:刘哥
 *@Date:15:24 2022/7/11
 */
public class Around implements MethodInterceptor {
    @Override
    public Object invoke(MethodInvocation methodInvocation) throws Throwable {
        Object result =null;
        try {
            System.out.println("前置通知：我爱插队");
            result=methodInvocation.proceed();//触发核心方法执行
            System.out.println("后置通知:那个sb插我队");
        } catch (Throwable throwable) {
            throwable.printStackTrace();
            System.out.println("异常通知:还想插队门都没有");
        } finally {
            System.out.println("最终通知:我还是老老实实排队吧");
        }
        return result;
    }

}
